<template>
<div>
  <h4>用户注册时间线折线图</h4>
  <div ref="chart" style="width: 700px; height: 350px;"></div>

</div>
   
</template>

<script>
import * as echarts from "echarts";

export default {
  mounted() {
    this.renderChart();
  },
  methods: {
    renderChart() {
      const chartData = {
        // x轴数据
        xData: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
        // y轴数据
        seriesData: [
          {
            name: "类别1",
            data: [120, 132, 101, 134, 90, 230, 210],
            type: "line",
            stack: "总量",
          },
          {
            name: "类别2",
            data: [220, 182, 191, 234, 290, 330, 310],
            type: "line",
            stack: "总量",
          },
          {
            name: "类别3",
            data: [150, 232, 201, 154, 190, 330, 410],
            type: "line",
            stack: "总量",
          },
        ],
      };

      const myChart = echarts.init(this.$refs.chart);

      const option = {
        tooltip: {
          trigger: "axis",
        },
        legend: {
          data: ["类别1", "类别2", "类别3"],
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: chartData.xData,
        },
        yAxis: {
          type: "value",
        },
        series: chartData.seriesData,
      };

      myChart.setOption(option);
    },
  },
};
</script>

<style>

</style>